{include file='public/head' /}
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-lg-10 col-md-offset-2 main" id="main">
      <div class="row">
        <div class="col-md-5">
          <h1 class="page-header">添加用户</h1>
          <form action="{:url('admin/users/adduserss')}" method="post">
            <div class="form-group">
              <label for="category-name">用户名</label>
              <input type="text"  id="username" name="username" class="form-control" placeholder="请输入用户名" required autocomplete="off">
            </div>  
            <div class="form-group">
              <label for="category-alias">密码</label>
              <input type="password" id="password" name="password" class="form-control" placeholder="请输入密码" required autocomplete="off">
            </div> 
            <div class="form-group">
              <label for="category-alias">邀请码</label>
              <input type="text" name="code" class="form-control" placeholder="请输入邀请码" required autocomplete="off">
             </div>
            <div class="form-group">
              <input type="checkbox" name="agree" value="1"> <span>本人同意</span> <a href="#">《开户协议》</a>
             </div>
             <button class="btn btn-primary" type="submit" id="btn">确认</button>
             <button class="btn btn-primary" type="reset">清除</button>
          </form>
        </div>
      </div>
    </div>
  </div>
</section>
</body>
</html>
<script type="text/javascript">
  $("#btn").click(function(){
      var username = $("#username").val();
      var password = $("#password").val();
      if(!(/^[a-zA-Z][a-zA-Z0-9_-]{5,15}$/).test(username)){
        alert("请输入字母开头的6-15位字母、数字、下划线");
        return false;
      }
      if(!(/^[a-zA-Z0-9_-]{6,20}$/).test(password)){
        alert("请使用6-20位英文，数字及下划线组合");
        return false;
      }
      
  })
</script>
